package com.memory.api.controller.inner;

import com.memory.api.service.UserService;
import com.memory.common.model.entity.User;
import com.memory.client.feignClient.UserFeignClient;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 该服务仅内部调用，不是给前端的
 */
@RestController
@RequestMapping("/user/inner")
public class UserInnerController implements UserFeignClient {

    @Resource
    private UserService userService;

    /**
     * 数据库中查是否已分配给用户秘钥（accessKey）
     * @param accessKey
     * @return
     */
    @Override
    @GetMapping("/get/invoke")
    public User getInvokeUser(@RequestParam(value = "accessKey") String accessKey) {
        return userService.getInvokeUser(accessKey);
    }

}